Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 48fa16c93a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| cpuTimeNs: | ||
| cpuTimeValues.length > 0 ? cpuTimeValues.reduce((total, value) => total + value, 0) : null, | ||
| residentMemoryBytes: | ||
| residentMemoryValues.length > 0 | ||
| ? residentMemoryValues.reduce((total, value) => total + value, 0) |
There was a problem hiding this comment.
Aggregate only latest sample per PID before summing metrics
summarizeIosDevicePerfSnapshot currently sums every matched row’s cpuTimeNs and residentMemoryBytes, but activity-monitor-process-live exports can include multiple rows for the same process within one capture (e.g., multiple timestamps or ref rows), so this double-counts cumulative CPU time and resident memory and can significantly over-report both metrics. This affects any device run where xctrace emits more than one row per PID; the snapshot should collapse to one row per PID (typically latest/max) before aggregation.
Useful? React with 👍 / 👎.
Summary
Add physical iOS CPU and memory sampling to
perf.How it works:
session-perfkeeps one cross-platform response shape and routes Apple sampling through the active session bundle ID.ps/simctl spawn ps.xcrun devicectl device info appsxcrun devicectl device info processesxcrun xctrace record --template "Activity Monitor"capturesactivity-monitor-process-livetableopenround-trip metric already exposed byperf.Validation
pnpm formatpnpm check:quickpnpm check:unitpnpm clean:daemonnode --experimental-strip-types src/bin.ts --session adr-ios-pr-clean open AgentDeviceRunner --platform ios --device "thymikee-iphone"node --experimental-strip-types src/bin.ts --session adr-ios-pr-clean appstatenode --experimental-strip-types src/bin.ts --session adr-ios-pr-clean perfnode --experimental-strip-types src/bin.ts --session adr-ios-pr-clean close